﻿@model ChinaCircleJerk.Models.IndexVm
@{
    ViewBag.Title = "Home Page";
}

<div class="jumbotron">
    <h1>CCJerk</h1>
    <p class="lead">Jerk here, not there</p>
</div>
<p>@Html.ActionLink("New Post", "Create", "Home")</p>
<div class="row">
    <div class="col-md-9">
    <h2>Jerkboard</h2>
    <p>Posts go here</p>
        <hr />
        @foreach (var p in Model.AllPosts)
        {
            <div class="col-md-9">
                <p>@Html.ActionLink(p.Title, "Details", "Home", new { id = p.PostId }, "")
                <p>
                    By: @p.User on @p.DateCreated.DayOfWeek - 
                    @if (Model.UserId == p.UserId)
                    {
                        @Html.ActionLink("Edit", "Edit", "Home", new { id = p.PostId }, "")
                    } | 
                    @if (Model.UserId == p.UserId)
                    {
                        @Html.ActionLink("Delete", "DeletePost", "Home", new { id = p.PostId }, "")
                    }
                </p>
                <hr />
            </div>
        }
    </div>
    <div class="col-md-3">
        <h2><img src="http://b.thumbs.redditmedia.com/AV49dtfMrK1SBHV3_3tT0S5BydzMbiW_bIqkY6DCdyg.png"></h2>
        <p>Commands to post stuff and assorted other info can live here.  Or not.  We'll see.</p>
    </div>
</div>